import { VARIABLE_SHAPE, COLLECTION_SHAPE } from 'gt-graphic/constant'

export const shape = {
  isCollection(shape: string) {
    return COLLECTION_SHAPE.includes(shape)
  },
  isVariable(shape: string) {
    return VARIABLE_SHAPE.includes(shape)
  }
}

export function unShapeData(data: GtGraphic.NodeData<GtGraphic.NodeData>) {
  return Object.values(data).flatMap(function (item) {
    return Object.values(item.value)
  })
}
